<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Licence extends Model
{
	const CREATED_AT = 'insert_time';
    const UPDATED_AT = 'update_time';
    /**
     * 与模型关联的数据表。
     *
     * @var string
     */
    protected $table = 'lexiang_licence';

    protected $primaryKey = 'licence_id';

    public $timestamps = false;

    /**
     * 可以被批量赋值的属性。
     *
     * @var array
     */
    protected $fillable = [
    	'users_id','identity_confirm',
    	'identity_imgs','business_confirm',
    	'business_img','foodpermit_confirm',
    	'foodpermit_img','identity_insert_time',
    	'business_insert_time','foodpermit_insert_time',
    	'insert_time','update_time'
    ];

    /**
     * 
     */
    public function editAction($editData,$cateid)
    {
    	$nowTime = time();
    	$editData['update_time'] = $nowTime;
    	$editobj = self::find($cateid);
    	foreach ($editData as $key => $value) {
    		$editobj->$key = $value;
    	}
    	$editres = $editobj->save();
    	return $editres;
    }
}
